'use strict';

module.exports = app => {
    const { STRING, UUID, UUIDV4, INTEGER, DECIMAL, DATE } = app.Sequelize;

    const model = app.model.define('project', {
        id: {
            type: UUID,
            defaultValue: UUIDV4,
            primaryKey: true,
            comment: 'Id',
        },
        proj_name: {
            type: STRING,
            allowNull: false,
            comment: '项目名称',
        },
        proj_code: {
            type: STRING,
            comment: '项目代码',
        },
        plan_sale_time: {
            type: DATE,
            comment: '预计成交时间',
        },
        userid: {
            type: UUID,
            comment: '业务员Id',
        },
        amount: {
            type: DECIMAL,
            comment: '项目金额',
        },
        fee: {
            type: DECIMAL,
            comment: '拜访费用',
        },
        ms1: {
            type: STRING,
            comment: '描述1',
        },
        ms2: {
            type: STRING,
            comment: '描述2',
        },
        ms3: {
            type: STRING,
            comment: '描述3',
        },
        ms4: {
            type: STRING,
            comment: '描述4'
        },
        remark: {
            type: STRING,
            comment: '备注'
        },
    }, {
            tableName: 'project',
            comment: '项目表',
        });

    return model;
};
